// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.imsl.finance;

import java.util.GregorianCalendar;

// Referenced classes of package com.imsl.finance:
//            BasisPart

class BasisPartNASD
    implements BasisPart
{

    BasisPartNASD()
    {
    }

    public int daysBetween(GregorianCalendar gregoriancalendar, GregorianCalendar gregoriancalendar1)
    {
        int i = gregoriancalendar.get(5);
        int j = gregoriancalendar.get(2);
        int k = gregoriancalendar.get(1);
        int l = gregoriancalendar1.get(5);
        int i1 = gregoriancalendar1.get(2);
        int j1 = gregoriancalendar1.get(1);
        boolean flag = isLastDayofFeb(gregoriancalendar, i, j, k);
        boolean flag1 = isLastDayofFeb(gregoriancalendar1, l, i1, j1);
        if(flag1 && flag)
            l = 30;
        if(flag)
            i = 30;
        if(i == 31)
            i = 30;
        if(l == 31 && i >= 30)
            l = 30;
        return (j1 - k) * 360 + (i1 - j) * 30 + (l - i);
    }

    public int getDaysInYear(GregorianCalendar gregoriancalendar, GregorianCalendar gregoriancalendar1)
    {
        return 360;
    }

    public double daysInPeriod(GregorianCalendar gregoriancalendar, int i)
    {
        return 360D / (double)i;
    }

    private static boolean isLastDayofFeb(GregorianCalendar gregoriancalendar, int i, int j, int k)
    {
        if(j == 1)
        {
            byte byte0 = ((byte)(gregoriancalendar.isLeapYear(k) ? 29 : 28));
            return i == byte0;
        } else
        {
            return false;
        }
    }
}
